<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // +=
        var a = 1;
        var b = 2;
        a += b;
        console.log('a = ' + a);

        // -=
        var a = 6;
        var b = 2;
        a -= b;
        console.log('a = ' + a);

        // *=
        var a = 2;
        var b = 3;
        a *= b;
        console.log('a = ' + a);

        // /=
        var a = 6;
        var b = 3;
        a /= b;
        console.log('a = ' + a);

        // %=
        var a = 11;
        var b = 4;
        a %= b;
        console.log('a = ' + a);
    </script>

</body>

</html>

<!-- 表达式和运算符 -->
<!-- https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators -->

<!-- JavaScript中的基础数学 — 数字和操作符 -->
<!-- https://developer.mozilla.org/zh-CN/docs/Learn/JavaScript/First_steps/Math -->